
#import <UIKit/UIKit.h>


@class ReplaceAnimation;


@interface PointObj : NSObject
{
@public
	CGFloat x, y;
}
@end




void initRectFromDevice( void );


double getLength( CGPoint p1, CGPoint p2 );
CGPoint getCenterPos( CGPoint p1, CGPoint p2 );


CGRect getAspectRect( CGRect rect, CGRect base_rect );


CGRect getDispRectFromDevice( void );
CGRect getBarRectFromDevice( void );
void resizeViewFromDevice( UIView *view );


CGRect createRect( CGPoint center, CGFloat width, CGFloat height );
BOOL isInsidePointOnRect( CGRect rect, CGPoint check_pt );
BOOL isInsideRectOnRect( CGRect rect1, CGRect rect2 );
BOOL isPointOnPolygon( PointObj* p, NSArray* poly );
CGRect getDispRect( UIDeviceOrientation orie );
CGRect getToolBarRect( UIDeviceOrientation orie );
CGRect getTabBarRect( UIDeviceOrientation orie );


void setCAAnimation( UIView* view, NSString* type, NSString* sub_type, CGFloat duration );
void setCAAnimation2( UIView* view, NSString* type, NSString* sub_type, CGFloat duration, id delegate );
void setUIViewAnimation( UIView* view, UIViewAnimationTransition trans_type, CGFloat duration );


int searchViewOnView( UIView* on_view, UIView* search_view );
BOOL isViewOnView( UIView* on_view, UIView* search_view );
int removeViewOnView( UIView* on_view, UIView* del_view );
void removeViewAllOnView( UIView* on_view );

void replaceViewAnimation(UIView* on_view, UIView* new_view, UIView* old_view, ReplaceAnimation* anim);
void replaceView( UIView* on_view, UIView* new_view, UIView* old_view );
void replaceViewCAAnim( UIView* on_view, UIView* new_view, UIView* old_view,
					   BOOL is_anime, NSString* anime_type, NSString* anime_subtype, CGFloat duration
);
void replaceViewUIViewAnim( UIView* on_view, UIView* new_view, UIView* old_view,
						   BOOL is_anime, UIViewAnimationTransition trans_type, CGFloat duration
);


BOOL isDeviceLandScape( UIDeviceOrientation device_orie );


NSString* convertString( NSString* base, NSString* before, NSString* after, BOOL is_loop );
NSString* convertUnuseFileNameString( NSString* base, NSString* convert );
NSString* convertPathString( NSString* base, int num );
NSString* convertAmp2And(NSString* string);
NSString* encodeURLComponent(NSString* uri);

UIImage* resizeImage(UIImage* src, CGSize size);


UIImage* captureView(UIView* view);
UIImage* captureLayer(CALayer* layer);


BOOL movieFormat(NSString* path);
BOOL audioFormat(NSString* path);
